-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
qr code generation optional argument #277
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #277 +/- ##
==========================================
- Coverage 37.80% 37.59% -0.21%
==========================================
Files 19 19
Lines 3214 3221 +7
==========================================
- Hits 1215 1211 -4
- Misses 1999 2010 +11 ☔ View full report in Codecov by Sentry. |
Thanks for your contribution. I don't understand the security aspect that is claimed to exist here. Is this just about the alleged time.it takes to scan a code vs the time it takes to copy a standard 2 word code by hand? |
First, thank you for taking the time to look over my pr.
Yeah more or less it's just easier to scan a qr code, which is done automatically, than taking the time to copy a code. I don't think it's that big of a deal at the end of the day, I just also like having the option of changing the default. It seems as though the maintainers are leaning towards qr code by default, which has the benefit of being better for those who do not mind this default and usage being consistent across multiple versions of magic-wormhole-cli. I made another branch that keeps the same default as before unless you use the |
Alright, as the python client went with QR code as default I think this is what we should do too :) If anything else because we are already doing this, and I like to adhere to semver backwards compatibility for the CLI as well, as the version numbers are linked.
It doesn't matter much to me. Force push this one, create a new PR and close this one, whatever is best for you. While we are touching this part, I was wondering if the PrintCodeFn arguments could be factored into a struct that's shared with |
Ok, I forced pushed my changes from the other branch so it's now qr by default. I fully agree with your reasoning here. Made an empty commit just to re-trigger the failed coverage test and then it work. Weird.
I agree it was a bit weird the way things work with PrintCodeFn and can probably be done in a cleaner way. I was initially trying to pass the full CommonLeaderArgs struct into parse_and_connect and then quickly realized that there were all these other arguments in there and that sender_print_code relied on PrintCodeFn and decided that I wanted to make as few changes as possible to make this work. Accept these changes for now. I will create a new issue to reference this so at least it's out there, and then it can be addressed in a future PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made a tiny remark, otherwise LGTM
The people developing for magic wormhole python seem to want to implement qr code generation as an option, ready for their next release. I thought it would make sense to add an argument to optionally suppress qr code generation due to the minor security risk it poses for always having it on. This implementation suppresses it by default without the
--qr
option but if you have a preference for the other way I have another branch I can merge for the--no-qr
optional implementation. Let me know what you think. Thanks.For
--help
:qr code suppressed:
--qr
added: